home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS05.ADF / IFF / packer.h < prev    next >
C/C++ Source or Header  |  1986-04-20  |  2KB  |  51 lines

  1.  
  2. #ifndef PACKER_H
  3. #define PACKER_H
  4. /*----------------------------------------------------------------------*
  5.  * PACKER.H  typedefs for Data-Compresser.                1/22/86
  6.  *
  7.  * This module implements the run compression algorithm "cmpByteRun1"; the
  8.  * same encoding generated by Mac's PackBits.
  9.  *
  10.  * By Jerry Morrison and Steve Shaw, Electronic Arts.
  11.  * This software is in the public domain.
  12.  *
  13.  * This version for the Commodore-Amiga computer.
  14.  *----------------------------------------------------------------------*/
  15.  
  16. #ifndef COMPILER_H
  17. #include "iff/compiler.h"
  18. #endif
  19.  
  20. /* This macro computes the worst case packed size of a "row" of bytes. */
  21. #define MaxPackedSize(rowSize)  ( (rowSize) + ( ((rowSize)+127) >> 7 ) )
  22.  
  23.  
  24. #ifdef FDwAT  /* Compiler handles Function Declaration with Argument Types */
  25.  
  26. /* Given POINTERS to POINTER variables, packs one row, updating the source
  27.  * and destination pointers. Returns the size in bytes of the packed row.
  28.  * ASSUMES destination buffer is large enough for the packed row.
  29.  * See MaxPackedSize. */
  30. extern LONG PackRow(BYTE **, BYTE **, LONG);
  31.           /*  pSource, pDest,   rowSize */
  32.  
  33. /* Given POINTERS to POINTER variables, unpacks one row, updating the source
  34.  * and destination pointers until it produces dstBytes bytes (i.e., the
  35.  * rowSize that went into PackRow).
  36.  * If it would exceed the source's limit srcBytes or if a run would overrun
  37.  * the destination buffer size dstBytes, it stops and returns TRUE.
  38.  * Otherwise, it returns FALSE (no error). */
  39. extern BOOL UnPackRow(BYTE **, BYTE **, WORD,     WORD);
  40.             /*  pSource, pDest,   srcBytes, dstBytes  */
  41.  
  42. #else /* not FDwAT */
  43.  
  44. extern LONG PackRow();
  45. extern BOOL UnPackRow();
  46.  
  47. #endif /* FDwAT */
  48.  
  49. #endif
  50.  
  51.